//-----------------------------------------------------------------------
// <copyright file="AccountCreatePresenter.cs" company="Simnova LLC">
//     Copyright (c) Simnova LLC. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Simnova.Collaborate.Presenter
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Simnova.Collaborate.View;

    public class AccountCreatePresenter
    {
        private IAccountCreate accountCreateView;

        public AccountCreatePresenter(IAccountCreate accountCreateView)
        {
            this.accountCreateView = accountCreateView;
        }

        public void CreateAccount()
        {
            AppServer.User user = new AppServer.User();
            user.EmailAddress = this.accountCreateView.EmailAddress;
            user.Password = this.accountCreateView.Password;
            user.ScreenName = this.accountCreateView.ScreenName;

            AppServer.CollaborateServiceClient collaborateClient = new AppServer.CollaborateServiceClient();
            collaborateClient.SaveUser(user);
            collaborateClient.Close();
        }
    }
}